package com.wwm.petadopt;

import org.json.JSONObject;

import java.util.Iterator;

/**
 * Created by maaibin on 2015/5/24.
 */
public class AdoptionRecord {
    public String adoptionRecord="领养记录：\n";

    public AdoptionRecord(JSONObject response)
    {
        Iterator it = response.keys();
 int i=0;
        while (it.hasNext()) {
            try {
                i++;
                String key = (String) it.next();
                String value = response.getString(key);
                JSONObject j = response.getJSONObject(key);
                adoptionRecord +=i+"." +j.getString("adopttime") + "领养了" + j.getString("type_name") + j.getString("aniName") + "\n";
            }catch(Exception e){}
            //petIDArray.add(Integer.parseInt(value));
        }

           // this.adoptionDate = response.getString("petDetailadoptionDate");



    }
    public String getAdoptionRecord()
    {
        return adoptionRecord;
    }
}
